﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sealight.Core.Domain
{
   public class ProductVariantAttributeValueEntity:BaseEntity
    {
        /// <summary>
        /// Gets or sets the product variant attribute value identifier
        /// </summary>
        public virtual Guid ProductVariantAttributeValueID { get; set; }

        /// <summary>
        /// Gets or sets the product variant attribute mapping identifier
        /// </summary>
        public virtual ProductVariantAttributeEntity ProductVariantAttribute { get; set; }

        /// <summary>
        /// Gets or sets the product variant attribute name
        /// </summary>
        public virtual string Name { get; set; }

        /// <summary>
        /// Gets or sets the price adjustment
        /// </summary>
        public virtual decimal PriceAdjustment { get; set; }

        /// <summary>
        /// Gets or sets the weight adjustment
        /// </summary>
        public virtual decimal WeightAdjustment { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the value is pre-selected
        /// </summary>
        public virtual bool IsPreSelected { get; set; }

        /// <summary>
        /// Gets or sets the display order
        /// </summary>
        public virtual int DisplayOrder { get; set; }

        public virtual Sealight.Core.DataAdapter.product_variant_attribute_value ToDataAdapter()
        {
            return new DataAdapter.product_variant_attribute_value {id=this.ProductVariantAttributeValueID, display_order=this.DisplayOrder, is_pre_selected=this.IsPreSelected,
                                                                    name = this.Name,
                                                                    price_adjustment = this.PriceAdjustment,
                                                                    weight_adjustment = this.WeightAdjustment,
                                                                    product_variant_attribute_id = this.ProductVariantAttribute!= null ? this.ProductVariantAttribute.ProductVariantAttributeID:Guid.Empty
            };
        }
    }
}
